package com.itheima.tliasmanagent.exception;

import com.itheima.tliasmanagent.pojo.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class GlobalExceptionHandler {

    @ExceptionHandler
    public Result ex(Exception e){
       // log.info("异常信息 {}",e);
        System.out.println("==============");
        e.printStackTrace();
        return Result.error("对不起,服务器异常,请联系管理员");
    }
}
